﻿@model MyMVCDemo.Controllers.Student

@{
    ViewBag.Title = "Index";
}

<h2>Index</h2>

<script src="@Url.Content("~/Scripts/jquery.validate.min.js")" type="text/javascript"></script>
<script src="@Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js")" type="text/javascript"></script>
<script src="../../Scripts/JsonCommon.js" type="text/javascript"></script>
@using (Html.BeginForm("SaveStudent","Json",FormMethod.Post))
{
    @Html.ValidationSummary(true)
    <fieldset>
        <legend>Student</legend>

        <div class="editor-label">
            @Html.LabelFor(model => model.FirstName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.FirstName)
            @Html.ValidationMessageFor(model => model.FirstName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.LastName)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.LastName)
            @Html.ValidationMessageFor(model => model.LastName)
        </div>

        <div class="editor-label">
            @Html.LabelFor(model => model.Age)
        </div>
        <div class="editor-field">
            @Html.EditorFor(model => model.Age)
            @Html.ValidationMessageFor(model => model.Age)
        </div>
       
        <p>
            <input type="button" value="List Student" id="GetStudent" />
            <input type="submit" value="Create" id="SaveStudent" />
        </p>
    </fieldset>
     @Html.Hidden("studenData")
    <div id="StudentList">
        
    </div>
}

<div>
    @Html.ActionLink("Back to List", "Index")
</div>
